<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<div>
用户名：<input type="text" id="username"><br>
密码:  <input type="password" id="password"><br>
    记住我  <input type="checkbox" id="rememberMe">
    <button class="button" onclick="login()">登录</button>
</div>
    <script>
        function login(){
            var username=$("#username").val();
            var password=$("#password").val();
            var rememberMe=$("rememberMe").val();
            $.ajax({
                url: "/admin/login",
                contentType: "application/json; charset=utf-8",
                data: JSON.stringify({"userName":username,"password":password,"rememberMe":true}),
                type: "post",
                dataType: 'json',
                success: function (data) {
                    console.log(data)
                  if(data.success==1){
                      window.location="/swagger-ui.html";
                  }
                }
            });
            }
        function logout() {
            $.get("/admin/logout",function (result) {
                alert(result);
            })
        }
    </script>
</body>
</html>